<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <#include "/pubHeadStyle.html">
</head>
<body>
<div style="position: relative;height: 100%;">
    <div class=" user" style="position: absolute;top:10px;bottom: 0">
        <input type="hidden" name="selectedNodeId">
        <input type="hidden" name="selectedNodeName">
        <table class="layui-hide" id="nodeList" lay-filter="flowList" style=""></table>
    </div>
</div>
<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index','table', 'layer', 'form','commons', 'totalFilter', 'setter'], function () {
        var table = layui.table, layer = layui.layer, setter = layui.setter, commons = layui.commons,
            totalFilter = layui.totalFilter, form = layui.form,$=layui.$;
        $.ajax({
            method:'post'
            , url: serverPath.workflowPath + setter.workflowLinkPath +'actDefModel/nodeSelector'
            ,data:{modelKey:'${modelKey}'}
            ,dataType:'json'
            ,success:function (res) {
                var _dataMap = res.data;
                var _data=[];
                $.each(_dataMap,function (key, value) {
                    var _json={};
                    _json.nodeId=key;
                    _json.nodeName=value;
                    _data.push(_json);
                });
                render(_data);
            }
        });
        function render(_data) {
            table.render({
                elem: '#nodeList'
                , title: '节点选择'
                , height: 'full-75'
                , width: 640
                , data:_data
                , defaultToolbar: []
                , cols: [[
                    {type: 'radio', fixed: 'left', width: 100}
                    , {field: 'nodeName', title: '节点名称', align: 'center'}
                ]]
                , page: true
            });
        }

        table.on('radio(flowList)',function (obj) {
            var data = obj.data;
            $("input[name=selectedNodeId]").val(data.nodeId);
            $("input[name=selectedNodeName]").val(data.nodeName);
        });


    })
</script>
</body>
</html>